package com.cn.wanxi.util.utils;

import com.cn.wanxi.util.model.BannerModel;

import java.util.ArrayList;
import java.util.List;

public class BannerUtile {
    FileUtile fileUtile =new FileUtile();
    public List<BannerModel> readBanner(){
        List<BannerModel> bannerList =new ArrayList<>();
        String banner = fileUtile.readFileToString("BannerFile.txt");
        String[] banners =banner.split(";");
        for (int i = 0;i<banners.length;i++){
            String item = banners[i];
            String[] info = item.split(",");
            BannerModel bannerModel = new BannerModel(info[0].trim(),info[1].trim());
            bannerList.add(bannerModel);
        }
        return bannerList;
    }
}
